package com.softtown.modules.workflow.dao;

import com.softtown.common.dao.BaseDao;
import com.softtown.modules.workflow.entity.SwfNextAprvDefEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author: Dingyayong
 * @Date: 2019/8/22 15:38
 * @Description:
 */
@Mapper
public interface SwfNextAprvDefDao extends BaseDao<SwfNextAprvDefEntity> {

    /**
     * 出差申请获取下一审批人默认值
     *
     * @param userId
     * @param compId
     * @return SwfNextAprvDefEntity
     * @author Dingyayong
     * @date 2019/8/22 17:03
     */
    SwfNextAprvDefEntity getNextAprvt(@Param("userId") Long userId, @Param("compId") Long compId);

    /**
     * 差旅报销申请申请获取下一审批人默认值
     *
     * @param compId
     * @param userId
     * @return SwfNextAprvDefEntity
     * @author Dingyayong
     * @date 2019/8/22 17:03
     */
    SwfNextAprvDefEntity getExpenseNextAprvt(@Param("userId") Long userId, @Param("compId") Long compId);

    /**
     * 获取下一审批人默认值
     * @param userId
     * @param compId
     * @param docTypeValue
     * @return com.softtown.modules.entity.SwfNextAprvDefEntity
     * @Author fuming
     * @Date 2020/5/27 17:28
     */
    SwfNextAprvDefEntity getAllNextAprvt(@Param("userId") Long userId, @Param("compId") Long compId, @Param("docTypeValue") String docTypeValue);

    /**
     * 更新
     * @param swfNextAprvDefEntity
     * @return void
     * @Author fuming
     * @Date 2020/5/27 17:29
     */
    void updateSwfNextAprvDef(SwfNextAprvDefEntity swfNextAprvDefEntity);

    /**
     * 借款申请获取下一审批人默认值
     *
     * @param userId
     * @param compId
     * @return com.softtown.modules.entity.SwfNextAprvDefEntity
     * @author fuming
     * @date 2019/10/29 13:17
     */
    SwfNextAprvDefEntity getAdvNextAprvDef(@Param("userId") Long userId, @Param("compId") Long compId);

    /**
     * 根据类型获取下一审批人默认值
     * @param userId
     * @param compId
     * @param docType
     * @return com.softtown.modules.entity.SwfNextAprvDefEntity
     * @Author fuming
     * @Date 2020/5/27 17:29
     */
    SwfNextAprvDefEntity getNextAprvtByDocType(@Param("userId") Long userId, @Param("compId") Long compId, @Param("docType") String docType);

    /**
     * 获取下一个审批人的上一审批人段终审值
     * @param userId
     * @param compId
     * @param nextAprvUserId
     * @param docTypeValue
     * @return java.lang.Integer
     * @Author fuming
     * @Date 2020/5/27 17:30
     */
    Integer selectIsPhaseLastAprv(@Param("userId") Long userId,@Param("compId") Long compId, @Param("nextAprvUserId") Long nextAprvUserId, @Param("docTypeValue") String docTypeValue);
}
